<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="renderer" content="webkit">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title>客户沟通列表</title>
		<link rel="stylesheet" href="/Public/frame/layui/css/layui.css">
			<!--<link rel="stylesheet" href="http://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css">-->
		<link rel="stylesheet" href="/Public/frame/static/css/style.css">
	</head>
	<body>
		<!-- <a><button class="layui-btn" style="margin-top: 10px;"><i class="layui-icon">&#xe654;</i>添加客户</button></a> -->
    	<a class="layui-btn btn-add btn-default" id="btn-refresh" style="margin-top: 10px;"><i class="layui-icon">&#x1002;</i></a>
    	<table class="layui-table" border="" cellspacing="" cellpadding="" width="100%">
    		    <thead>
              <tr>
                <td width="10%">序号</td>
                <td width="30%">时间</td>
                <td width="60%">沟通记录</td>
              </tr>
            </thead>
            <tbody>
<?php if(count($cus['communicate']) > 0 ): foreach ($cus['communicate'] as $k => $v):?>
                  <tr>
                    <td>1</td>
                    <td><?php echo date('Y-m-d H:i:s',$v['addtime']); ?></td>
                    <td><?php echo htmlspecialchars_decode($v['content']);?></td>
                  </tr>
<?php endforeach;?>
<?php if(preg_match('/\d/', $cus['page'])): ?>  
                  <tr><td align="right" nowrap="true" colspan="99" height="30" class="page"><?php echo $cus['page']; ?></td></tr> 
<?php endif; ?>  
            </tbody>
<?php else: ?><tbody><tr><td align="center" nowrap="true" colspan="99" style="font-size:24px;padding:30px 0;">该客户还无沟通记录，敬请期待更新！</td></tr></tbody><?php endif; ?>
    	</table>
	</body>
</html>
<script type="text/javascript" src="/Public/hawk/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="/Public/frame/layui/layui.js"></script>
    <script>
              // 刷新
        $('#btn-refresh').on('click', function () {
            location.reload();
        });
    layui.use(['layer','layedit', 'laydate'], function(){
          var layer = layui.layer
          ,layedit = layui.layedit
          ,laydate = layui.laydate;
        //查看客户详情
        $(document).on('click','.more',function(){
            var cid=$(this).attr('cid');
            layer.open({
              type: 2,
              title:'客户详细信息',
              area: ['900px', '600px'],
              fixed: false, //不固定
              maxmin: true,
              content: '/index.php/Hawk/Customer/moreInfo/id/'+cid
            });
        });       
    });
    
    </script>